package com.olinsports.system.olinsportssystem.repository;

import com.olinsports.system.olinsportssystem.model.InventoryDetails;
import com.olinsports.system.olinsportssystem.model.InventorySettings;
import com.olinsports.system.olinsportssystem.model.MultiCondition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * Created by Administrator on 2017/7/23.
 */
@Mapper
@CacheConfig(cacheNames = "inventorySettings")
public interface InventorySettingsRepository {
    @Cacheable
    public List<InventorySettings> selectAll();
    @Cacheable
    public int insertAll(InventorySettings inventorySettings);
    @Cacheable
    public int deleteByKey(int typeKey);
    @Cacheable
    public InventorySettings selectByKey(int inventoryKey);
    @Cacheable
    public int updateData(InventorySettings inventorySettings);
    @Cacheable
    public int findCount();
    @Cacheable
    public List<InventorySettings> findLimit(@Param("sord") String sord, @Param("sidx") String sidx, @Param("beg") int beg, @Param("end") int end);
    /**
     * 通过查询条件查出总个数
     * @param multiList
     * @return
     */
    @Cacheable
    public int  findByParamsCount(@Param("multiList") List<MultiCondition> multiList);

    /**
     * 通过查询条件进行分页查询
     * @param multiList
     * @param beg
     * @param end
     * @return
     */
    @Cacheable
    public List<InventorySettings> findByParamsLimit(@Param("sord") String sord, @Param("sidx") String sidx, @Param("multiList") List<MultiCondition> multiList, @Param("beg") int beg, @Param("end") int end);

}
